<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>排队设置</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  {include file="public/css"/}
</head>
<body>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-card layui-col-md12">
				<div class="layui-card-header"><i class="fa fa-cog"></i> 排队设置</div>
				<div class="layui-card-body" pad15>
					<div class="layui-form form-label-w6" lay-filter="">
						<div class="layui-form-item">
							<label class="layui-form-label">排队状态：</label>
							<div class="layui-input-inline">
								<input type="radio" name="info[status]" title="开启" value="1" {if $info['status']==1}checked{/if}/>
								<input type="radio" name="info[status]" title="关闭" value="0" {if $info['status']==0}checked{/if}/>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">可排队时间：</label>
							<div class="layui-input-inline" style="width:150px">
								<input type="text" name="info[start_hours]" class="layui-input" value="{$info.start_hours}" id="start_hours" autocomplete="off">
							</div>
							<div class="layui-form-mid">到</div>
							<div class="layui-input-inline" style="width:150px">
								<input type="text" name="info[end_hours]" class="layui-input" value="{$info.end_hours}" id="end_hours" autocomplete="off">
							</div>
							<div class="layui-form-mid layui-word-aux layui-clear">结束时间小于或等于开始时间表示跨天,如:00:00到00:00点表示全天可排队,16:00到06:00表示下午4点到次日早晨6点</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">屏幕标题：</label>
							<div class="layui-input-inline">
								<input type="text" name="info[screen_title]" value="{$info['screen_title']}" class="layui-input" >
							</div>
							<div class="layui-form-mid"></div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">屏幕背景图片：</label>
								<input type="hidden" name="info[screen_pic]" value="{$info['screen_pic']}" id="screen_pic"  class="layui-input" >
							<button style="float:left;" type="button" class="layui-btn layui-btn-primary" onclick="uploader(this)" upload-input="screen_pic" upload-preview="logoPreview">上传图片</button>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">建议尺寸：根据屏幕大小</div>
							<div id="logoPreview" style="float:left;padding-top:10px;margin-left:130px;clear: both;">
								<div class="layui-imgbox" style="width:100px;"><div class="layui-imgbox-img"><img src="{$info['screen_pic']}"/></div></div>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">屏幕底部文字：</label>
							<div class="layui-input-inline">
								<input type="text" name="info[screen_desc]" value="{$info['screen_desc']}" class="layui-input" style="width:600px;" >
							</div>
							<div class="layui-form-mid"></div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">大屏链接：</label>
							<div class="layui-input-inline">

							</div>
							<div class="layui-form-mid"><a href="{$Think.const.PRE_URL2}/?s=/RestaurantQueueScreen/index/aid/{$info.aid}/bid/{$info.bid}" target="_blank">在大屏幕打开此链接展示排队信息</a></div>
						</div>
						
						<div class="layui-form-item">
							<label class="layui-form-label"></label>
							<div class="layui-input-block">
								<button class="layui-btn" lay-submit lay-filter="formsubmit">提 交</button>
							</div>
						</div>
					</div>
				</div>
			</div>
    </div>
  </div>
	{include file="public/js"/}
	<script>
	layui.laydate.render({ 
		elem: '#start_hours',
		type: 'time',
		format:'HH:mm',
		trigger: 'click'
	});
	layui.laydate.render({ 
		elem: '#end_hours',
		type: 'time',
		format:'HH:mm',
		trigger: 'click'
	});
	layui.form.on('radio(freightfree)', function(data){
		if(data.value == '1'){
			$('#freightfreemoneyset').show();
		}else{
			$('#freightfreemoneyset').hide();
		}
	});
	layui.form.on('submit(formsubmit)', function(obj){
		var field = obj.field
		if(field['info[logo]'] == ''){
			dialog('请上传商家LOGO',0);return;
		}
		$.post("{:url('save')}",field,function(data){
			dialog(data.msg,data.status,data.url);
		})
	})
  </script>
	{include file="public/copyright"/}
</body>
</html>